import type { BaseResponse } from '../http'

export function getHomeHistoryWorks() {
  return http.get<BaseResponse<PreviousWorkItem[]>>('/client/home-page/previous-works')
}

export function getHomeIntro(scheduleId: string) {
  return http.get<BaseResponse>(`/client/home-page/intro/${scheduleId}`)
}
// 获取首页大赛动态
export function homeDynamic(scheduleId: string) {
  return http.get<BaseResponse>(`/client/home-page/dynamic/${scheduleId}`)
}
// 获取首页大赛简介
export function homeIntro(scheduleId: string) {
  return http.get<BaseResponse>(`/client/home-page/intro/${scheduleId}`)
}
// 获取组织接结构
export function orgList(scheduleId: string) {
  return http.get<BaseResponse>(`/service/orgInfo/getInfoByScheduleId?scheduleId=${scheduleId}`)
}
// 获取奖项图片
export function awardImg(params: {
  scheduleId: string
  type: string
}) {
  return http.get<BaseResponse>(`/service/award-img/getInfoByType?scheduleId=${params.scheduleId}&type=${params.type}`)
}
// 获取时间线图片
export function timeLine(params: {
  scheduleId: string
  type: string
}) {
  return http.get<BaseResponse>(`/service/time-line/getInfoByType?scheduleId=${params.scheduleId}&type=${params.type}`)
}
// BANNER
export function pageBanner(params: {
  scheduleId: string
  bannerType: string
}) {
  return http.get<BaseResponse<{ fileUrl: string }[]>>('/client/home-page/banner-info', { params })
}

export interface WorksImgVo {
  id: number
  fileName: string
  fileFormat: string
  fileUrl: string
}

export interface PreviousWorkItem {
  imgUrl?: any
  imgFileId?: any
  worksId: number
  worksImg: string
  worksImgVo: WorksImgVo[]
  worksName: string
  content: string
}
